<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class AdminRole extends Model
{
    protected $guarded = ['id'];

    public function menus(): BelongsToMany
    {
        return $this->belongsToMany(AdminMenu::class,'admin_role_menu_relation','role_id','menu_id');
    }

    public function resources(): BelongsToMany
    {
        return $this->belongsToMany(AdminResource::class,'admin_role_resource_relation','role_id','resource_id');
    }
}
